/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.csvgenerator.engine.vc;

import com.csvgenerator.engine.value.ValueProducer;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Administrator
 */
public class MultiplyValueCombinator extends ValueCombinator {
    private List<ValueProducer> producerReferences = new ArrayList<ValueProducer>();
    private Long factor = new Long(1);

    @Override
    public String nextValue() {
        Long nextValue = factor;
        for (ValueProducer vp : producerReferences) {            
            nextValue *= Long.parseLong(vp.getCurrentValue());            
        }                
        currentValue = nextValue.toString();
        return nextValue.toString();
    }

    /**
     * @return the producerReferences
     */
    public List<ValueProducer> getProducerReferences() {
        return producerReferences;
    }

    /**
     * @param producerReferences the producerReferences to set
     */
    public void setProducerReferences(List<ValueProducer> producerReferences) {
        this.producerReferences = producerReferences;
    }

    /**
     * @return the factor
     */
    public Long getFactor() {
        return factor;
    }

    /**
     * @param factor the factor to set
     */
    public void setFactor(Long factor) {
        this.factor = factor;
    }
    
}
